# Contributor: Shannon Noe <snoe925@gmail.com>
# Maintainer: Shannon Noe <snoe925@gmail.com>
pkgname=tclx
pkgver=8.4.1
pkgrel=1
pkgdesc="TclX extension to Tcl"
url="http://tclx.sourceforge.net/"
arch="all"
license="BSD"
depends="tcl"
depends_dev="tcl-dev"
makedepends="tcl-dev"
subpackages="$pkgname-doc $pkgname-dev"
source="https://downloads.sourceforge.net/project/tclx/TclX/$pkgver/$pkgname$pkgver.tar.bz2
	rresvport.patch
	"

_major=${pkgver%.*}
builddir="$srcdir"/tclx${_major}

build() {
	local _64bit="--disable-64bit"
	case "$CARCH" in
	x86_64) _64bit="--enable-64bit";;
	esac
	cd "$builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--with-tcl=/usr/lib \
		$_64bit \
		|| return 1
	make || return 1
}

package() {
	cd "$builddir"
	make -j1 DESTDIR="${pkgdir}" install || return 1
}

sha512sums="faad58f5d8e0e1e759da639800f354b583fb01418c94f2274924aa07beb0ee9559beb87b3386ed5ae3694700a71dfe5b8ac54ead0ec75c6963507e9d3ead7060  tclx8.4.1.tar.bz2
ab0c63de8c9fd6c6fca7a0901c876e013cfc76b5032f7b6dce7cad9d747d7baffd3b4b7ae6d24a34bc1c1c78dbd2bd8169eac27f9d7ed468675963e847f6917c  rresvport.patch"
